﻿using System;
using System.Windows.Forms;

namespace SecurePad
{
    static class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            FormMain mainForm = new FormMain();

            if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null)
            {
                string[] activationData = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData;
                if (activationData != null && activationData.Length > 0)
                {
                    Uri uri = new Uri(activationData[0]);
                    mainForm.OpenFile(uri.LocalPath.ToString());
                }
            }
            else if (args.Length > 0)
            {
                if (mainForm.OpenFile(args[0]) == false)
                {
                    return;
                }
            }

            Application.Run(mainForm);
        }
    }
}
